1. Field of the Invention
One or more embodiments of the present invention relate to debugging of built-in software, and more particularly, to a system, medium, and method of kernel-aware debugging which allow efficient debugging for developing an operating system or software which operates prior to the operating system.
2. Description of the Related Art
A debugger refers to a program or hardware which identifies or shows a state, e.g., values of a register and/or a memory, related to software being debugged, and can be used to control the performance of the software, e.g., in response to a user's input, to detect faults within the software or evaluate the performance thereof. Debuggers of built-in software can be categorized into software debuggers and hardware debuggers. The software debugger is mainly used to debug application programs and is developed using functions, such as ptrace or proc file system, provided by the kernel. In comparison, the hardware debugger is based on functions, such as JTAG (joint test action group) interface, provided by hardware and debugs mainly embedded software.
FIG. 1 illustrates architecture of an agent based software debugger. The architecture includes of a host system 110 acting as the debugger and a target system 120 including middleware 122 and/or application 124 software, which are to be debugged by the debugger. Here, the host system 110 and target system 120, having an OS kernel 126 the middleware 122 and application 124 software, communicate with one another.
Referring to FIG. 1, the software debugger may be implemented by adding a debugging agent module 128 to a target system 120, as a part of the kernel 126 or an application program. The host system 110 may control the debugging agent module 128 to perform a simple debugging command through a real time operating system (RTOS) kernel-aware debugging interface 114. The command to be performed by the debugging agent module 128 may be a command for setting or releasing a breakpoint, a command for reading or writing the value of a memory, or the like. The RTOS kernel-aware debugging interface 114 may allow the debugging agent module 128 to stop a central processing unit (CPU) of the target system 120 at a specific point and read a desired value of a memory address and store it in a trace storage unit 130 by combining the basic commands. The simple command to be performed by the debugging agent module 128 is transmitted to the debugging agent module 128 through a debugging agent interface module 118 of the host system 110, with the debugging agent interface module 118 creating the command with reference to a symbol information table 116 and receiving trace information collected by the debugging agent module 128. The debugging agent interface module 118 is under the control of a debugging interface module 114, which is superior to the debugging agent interface module 118. The debugging interface module 114, if necessary, collects and analyzes information about various operating system components and then outputs the information through a user interface 112, for example, while being aware of the architecture of the operating system being debugged.
The advantage of this technique is that it is thereby possible to debug the embedded software without a hardware debugging device. Moreover, it is possible to debug the detailed elements of the operating system independently. However, such a technique that performs debugging indirectly by transmitting the command to the debugging agent module 128 leads to more overhead in terms of performance, compared with other techniques, such as a hardware debugger, resulting in it being difficult to perform an advanced debugging function properly. Therefore, if use of a hardware debugger is possible, it is typically better to perform hardware based debugging according to the hardware debugging architecture illustrated in FIG. 2.
FIG. 2 illustrates architecture of a JTAG based hardware debugger, which utilizes a JTAG or boundary scan interface, which is one type of hardware debugging.
Referring to FIG. 2, like the above target system 120, a target system 230 includes middleware 232, an application 234, and an OS kernel 236. However, a difference between the two target systems is that a hardware JTAG module 238 acts as the debugging agent module 128. The hardware JTAG module 238 directly controls pins of the CPU of a target system 230 so that it can set a breakpoint and perform memory input/output quickly by way of hardware. Like the above host system 110, a host system 210 also may include a user interface 212, an RTOS kernel-aware debugging interface 214 and a symbol information table 216, while further controlling the JTAG module 238 of the target system 230 through a JTAG debugger interface 218. The JTAG debugger interface 218 may collect trace information, utilizing symbol information 216, and store the trace information in a trace storage unit 220, for example.
This conventional hardware debugging architecture provides capabilities for stopping and resuming the CPU, and accessing the input/output register and memory. In addition, such conventional kernel-aware debugging includes awareness of the data structure of the kernel and may, for example, provide a user with information such as the state of tasks or mutual exclusion (mutex) through a user interface.
However, such a conventional hardware debugging technique cannot provide advanced debugging capabilities such as a debugging capability for securing stability, which is valued in the course of software development, such as a debugging of temporarily occurring transient faults. The temporary faults can be caused by an asynchronous control flow, such as interrupt, and synchronizing and communication between tasks. However, since these events do not occur frequently, when the faults do occur, it is difficult to establish their causes and represent them if no appropriate debugging method is provided. Because the operating system and software are large and stability is important, debugging of the temporary faults is a very important requirement with regard to commercializing the operating system and software.